package com.lizonghui.googleplay.protocol;

import com.lizonghui.googleplay.base.BaseProtocol;
import com.lizonghui.googleplay.bean.ItemInfoBean;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by Administrator on 2016/6/24.
 */
public class DetailProtocol extends BaseProtocol<ItemInfoBean> {
    private String mPackageName;

    public DetailProtocol(String packageName) {
        mPackageName = packageName;
    }

  /*  @Override
    public ItemInfoBean parseJsonString(String resultJsonString) {
        Gson gson = new Gson();
        return gson.fromJson(resultJsonString, ItemInfoBean.class);//开始这里有错误时候，但是这里明显不可能有错误，应该从大的逻辑去分析。因为申请页面的key变了

    }
*/
    @Override
    public String getInterfaceKey() {
        return "detail";
    }

    @Override
    public Map<String, Object> getParmasHashMap(int index) {
        Map<String, Object> paramsHashMap = new HashMap<>();
        //packageName需要外部获取，我们可以从构造方法获取
        paramsHashMap.put("packageName", mPackageName);
        return paramsHashMap;
    }
}
